import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/login",
  },
  {
    path: "/login",
    name: "login",
    component: () => import("@/view/login/loginIndex.vue"),
  },
  {
    path: "/",
    component: () => import("@/view/layout/layoutIndex.vue"),
    children: [
      {
        path: "/home",
        name: "home",
        component: () => import("@/view/home/index.vue"),
      },
      {
        path: "/comments",
        name: "comments",
        component: () => import("@/view/comments/index.vue"),
      },
      {
        path: "/article",
        name: "article",
        component: () => import("@/view/article/index.vue"),
      },
      {
        path: "/publish",
        name: "publish",
        component: () => import("@/view/publish/index.vue"),
      },
      {
        path: "/usersettings",
        name: "usersettings",
        component: () => import("@/view/usersettings/index.vue"),
      },
    ],
  },
];
// route 路由信息
// router 路由实例化对象
const router = new VueRouter({
  routes,
});
// console.log(router,'luyi')

export default router;
